package com.jiayinlending.jiayindai.activity.home;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.OrientationHelper;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.widget.TextView;

import com.jiayinlending.jiayindai.R;
import com.jiayinlending.jiayindai.adapter.BoodListAdpater;
import com.jiayinlending.jiayindai.net.bean.Info;
import com.zhy.autolayout.AutoLayoutActivity;

import java.util.ArrayList;

import butterknife.Bind;
import butterknife.ButterKnife;

import static com.jiayinlending.jiayindai.R.id.toolbar_title;

public class BondlistActivity extends AutoLayoutActivity{

    @Bind(toolbar_title)
    TextView toolbarTitle;
    @Bind(R.id.toolbar)
    Toolbar toolbar;
    @Bind(R.id.recyler_bondlist)
    RecyclerView recylerBondlist;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_bondlist);
        ButterKnife.bind(this);
        initview();
        inittitleview();
    }

    private void inittitleview() {
        toolbarTitle.setText("债权列表");
    }

    private void initview() {
        ArrayList<Info> list2 = new ArrayList<>();
        for (int i = 0; i < 2; i++) {
            list2.add(new Info());
        }
        LinearLayoutManager layoutManager = new LinearLayoutManager(this);
        recylerBondlist.setLayoutManager(layoutManager);
        layoutManager.setOrientation(OrientationHelper.VERTICAL);
        recylerBondlist.setAdapter(new BoodListAdpater(this, list2));
    }
}
